using System;
using System.Collections.Generic;
using System.Reflection;

namespace Infinity.Statements.Utilities
{
	public interface ITypeManager
	{
		/// <summary>
		/// If types from Assembly
		/// </summary>
		void Add(Assembly assembly);

		/// <summary>
		/// It adds a new assembly
		/// </summary>
		/// <param name="assembly">Assembly's name</param>
		void Add(string assembly);

		void Add(string name, Type type);
		void Add<T>(string name);

		/// <summary>
		/// It adds a new type
		/// </summary>
		void Add(Type type);

		/// <summary>
		/// It removes type from TypeManager
		/// </summary>
		bool Remove(Type type);

		/// <summary>
		/// It unload the given assembly from TypeManager
		/// </summary>
		bool Remove(Assembly assembly);

		/// <summary>
		/// It resolves the given type name and returns
		/// </summary>
		Type ResolveType(string typeName);

		/// <summary>
		/// It resolves type by name. If there is not in any assembly, then it returns false. Otherwise it returns true.
		/// </summary>
		bool TryResolveType(string typeName, out Type type);

		/// <summary>
		/// Get types
		/// </summary>
		Type[] GetTypes();

		/// <summary>
		/// Get types by name
		/// </summary>
		IEnumerable<Type> GetTypes(string name);
	}
}